home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2003 December
/
CMCD1203.ISO
/
Software
/
Freeware
/
Grafica
/
advem
/
aemf10.exe
/
{app}
/
templates
/
jsmatriximage.js
< prev
next >
Wrap
Text File
|
2003-05-28
|
5KB
|
140 lines
document.writeln(''); var glyphs=new Array(); document.write('');
document.writeln(''); glyphs.push("../filehandling/readfile.jsp?fn=matrix1b.jpg"); document.write('');
document.writeln(''); glyphs.push("../filehandling/readfile.jsp?fn=matrix2b.jpg"); document.write('');
document.writeln(''); glyphs.push("../filehandling/readfile.jsp?fn=matrix3b.jpg"); document.write('');
document.writeln(''); glyphs.push("../filehandling/readfile.jsp?fn=matrix4b.jpg"); document.write('');
document.writeln(''); glyphs.push("../filehandling/readfile.jsp?fn=matrix5b.jpg"); document.write('');
document.writeln(''); glyphs.push("../filehandling/readfile.jsp?fn=matrix6b.jpg"); document.write('');
document.writeln(''); glyphs.push("../filehandling/readfile.jsp?fn=matrix7b.jpg"); document.write('');
document.writeln(''); glyphs.push("../filehandling/readfile.jsp?fn=matrix8b.jpg"); document.write('');
document.writeln(''); glyphs.push("../filehandling/readfile.jsp?fn=matrix9b.jpg"); document.write('');
// MATRIX BACKGROUND ANIMATION
// By: BRIAN GOSSELIN OF http://scriptasylum.com
// V1.0
// Permission granted to use this script in your webpage provided the
// credit remain intact.
//GLYPH IMAGE FILE NAMES.
var glyphs_b=glyphs;
var glyphCount=400;
var scrollSpeed=60;
var glyphD=15;
var disableColors=false;
var matrbr = 100;
var matrno = 50;
//************ DO NOT EDIT BEYOND HERE *************\\
var w3c=(document.getElementById)?true:false;
var ns4=(document.layers)?true:false;
var ie4=(document.all && !w3c)?true:false;
var ie5=(document.all && w3c)?true:false;
var ns6=(w3c && navigator.appName.indexOf("Netscape")>=0)?true:false;
var ie = (navigator.appVersion.indexOf("MSIE")>=0)?true:false;
var px = (window.opera)?'':'px';
var ids=new Array();
var wWidth, wHeight, colHeight;
var t='';
var counter=0;
var gx=new Array();
var ga=new Array();
for(i=0;i<glyphCount;i++){
gx[i]=Math.floor(Math.random()*glyphs.length);
t+=(ns4)?'<layer name="glyph'+i+'" top="-'+glyphD+'" left="0" width="'+glyphD+'" height="'+glyphD+'" z-index="1">':'<div id="glyph'+i+'" style="position:absolute; top:-'+glyphD+'px; left:0px; width:'+glyphD+'px; height:'+glyphD+'px; z-index:1">';
t+='<img src="'+glyphs[gx[i]]+'" width='+glyphD+' height='+glyphD+' name="g'+i+'" style="filter:alpha(opacity='+matrno+'); -moz-opacity:'+(matrno/100)+'">';
t+=(ns4)?'</layer>':'</div>';
}
document.write(t);
for(i=0;i<glyphs.length;i++){
ga[i]=new Image();
ga[i].src=glyphs_b[i];
}
function matrixInit(){
getWindowDims();
for(i=0;i<glyphCount;i++){
ids[i]=(ns4)?document.layers['glyph'+i]:(ie4)?document.all['glyph'+i]:document.getElementById('glyph'+i);
ids[i].gx=gx[i];
}
gx='';
//setInterval('scrollGlyphs()',10*scrollSpeed);
scrollGlyphs();
}
function brighten(idnum,b){
if (ie) document.images['g'+idnum].filters.alpha.opacity=(b)?matrbr:matrno; else document.images['g'+idnum].style.MozOpacity=((b)?matrbr:matrno)/100;
}
function moveID(idnum,x,y){
var id=ids[idnum];
if(ns4)id.moveTo(x,y);
else{
id.style.left=x+px;
id.style.top=y+px;
}
if(!disableColors){
brighten(idnum,true);
setTimeout('brighten('+idnum+',false)',scrollSpeed*1.3);
}}
function getWindowDims(){
wWidth=((ie4||ie5)&&!window.opera)? document.body.clientWidth:window.innerWidth;
wHeight=((ie4||ie5)&&!window.opera)? document.body.clientHeight:window.innerHeight;
colHeight=Math.min(Math.floor(wHeight/1.5/glyphD)-1,25);
}
function scrollGlyphs(){
var sx=((ie4||ie5)&&!window.opera)? document.body.scrollLeft:window.pageXOffset;
var sy=((ie4||ie5)&&!window.opera)? document.body.scrollTop:window.pageYOffset;
var pixx=Math.floor(Math.random()*wWidth/(glyphD+1))*glyphD+sx;
var pixy=Math.floor(Math.random()*(wHeight-(colHeight*glyphD)))+sy;
for(i=0; i<colHeight; i++){
setTimeout('moveID('+counter+','+pixx+','+(pixy+glyphD*i)+')', scrollSpeed*i);
counter=((counter+colHeight)>glyphCount)?0:counter+1;
}
setTimeout('scrollGlyphs()', scrollSpeed*colHeight/2);
}
window.onload=matrixInit;
window.onresize=getWindowDims;
//DO NOT MODIFY
/*
<APPLETINFO>
appletname=jsmatriximage
applettype=JAVASCRIPT
created=1054117706580
appletfilename=jsmatriximage1.js
</APPLETINFO>
<JAVASCRIPT>
gcount=400
sspeed=60
imdims=15
matrbr=100
matrno=50
</JAVASCRIPT>
<HTMLGENERATOR>
image=-
image_GS=2;images
mystarttag=-
mystarttag_GS=1;-
images_GS=4;-
images0=matrix1b.jpg
images1=matrix2b.jpg
images2=matrix3b.jpg
images3=matrix4b.jpg
images4=matrix5b.jpg
images5=matrix6b.jpg
images6=matrix7b.jpg
images7=matrix8b.jpg
images8=matrix9b.jpg
</HTMLGENERATOR>
*/